<?php 
class FirmsImagesGallery extends CWidget {
 
	/*
    public function init()    {     
    }
    */	
    
    public $images = array();
    public $ctrl = null;
    
    public function run() {
        $cs = Yii::app()->clientScript;
        $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/AD_Gallery_1_2_7/lib/jquery.ad-gallery.js', CClientScript::POS_END);
        $cs->registerScript('initADallery', "var galleries = $('.ad-gallery').adGallery();", CClientScript::POS_END); 
//or all gallery code go to fiel and file inclduing here        
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/js/AD_Gallery_1_2_7/lib/jquery.ad-gallery.css');
		$this->render('firmsImagesGallery', array(
			'images' => $this->images,
		));    
    }
    
    public function getFirmImgSrc($image, $key) {
        return Yii::app()->controller->getWidgetFirmImgSrc($image, $key);
    }
    
}


?>